# coding: utf-8

from elasticsearch import Elasticsearch

es = Elasticsearch(hosts="172.16.202.33")

print(es.indices.get('wangsir'))

# 关闭索引（使其不进行服务）
print(es.indices.close(index='wangsir'))
# 打开索引
print(es.indices.open(index='wangsir'))

print(es.indices.get_mapping(index='wangsir'))

# 是否存在别名
print(es.indices.exists_alias('haha'))